/**
 * 反射api Reflect.set()
 * 1.返回值
 * 布尔值
 * 
 * 2.触发拦截操作
 * proxy.foo = 'bar'
 * proxy['foo'] = 'bar2'
 * Object.create(proxy)['boo'] = 'bar3'
 * Reflect.set(proxy,'coo','bar4')
 * 
 */

const myTarter = {
    foo:'car'
}

const proxy = new Proxy(myTarter,{
    /**
     * 
     * @param {*} target 目标对象
     * @param {*} property 目标上的属性
     * @param {*} value 要设置的值
     * @param {*} receiver 代理对象
     */
    set(target,property,value,receiver){
        console.log('set()');
        return Reflect.set(...arguments)
    }
});

proxy.foo = 'bar'//set()
proxy['foo'] = 'bar2'//set()
Object.create(proxy)['boo'] = 'bar3'//set()
Reflect.set(proxy,'coo','bar4')//set()